.class Lcom/hyphenate/chat/EMChatManager$3;
.super Ljava/lang/Object;

# interfaces
.implements Lcom/hyphenate/EMCallBack;


# instance fields
.field final synthetic this$0:Lcom/hyphenate/chat/EMChatManager;

.field final synthetic val$conv:Lcom/hyphenate/chat/EMConversation;

.field final synthetic val$msg:Lcom/hyphenate/chat/EMMessage;

.field final synthetic val$oldId:Ljava/lang/String;

.field final synthetic val$originImagePath:Ljava/lang/String;


# direct methods
.method constructor <init>(Lcom/hyphenate/chat/EMChatManager;Lcom/hyphenate/chat/EMConversation;Ljava/lang/String;Lcom/hyphenate/chat/EMMessage;Ljava/lang/String;)V
    .locals 0

    iput-object p1, p0, Lcom/hyphenate/chat/EMChatManager$3;->this$0:Lcom/hyphenate/chat/EMChatManager;

    iput-object p2, p0, Lcom/hyphenate/chat/EMChatManager$3;->val$conv:Lcom/hyphenate/chat/EMConversation;

    iput-object p3, p0, Lcom/hyphenate/chat/EMChatManager$3;->val$oldId:Ljava/lang/String;

    iput-object p4, p0, Lcom/hyphenate/chat/EMChatManager$3;->val$msg:Lcom/hyphenate/chat/EMMessage;

    iput-object p5, p0, Lcom/hyphenate/chat/EMChatManager$3;->val$originImagePath:Ljava/lang/String;

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method


# virtual methods
.method public onError(ILjava/lang/String;)V
    .locals 0

    return-void
.end method

.method public onProgress(ILjava/lang/String;)V
    .locals 0

    return-void
.end method

.method public onSuccess()V
    .locals 4

    iget-object v0, p0, Lcom/hyphenate/chat/EMChatManager$3;->val$conv:Lcom/hyphenate/chat/EMConversation;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/hyphenate/chat/EMChatManager$3;->val$conv:Lcom/hyphenate/chat/EMConversation;

    invoke-virtual {v0}, Lcom/hyphenate/chat/EMConversation;->getCache()Lcom/hyphenate/chat/EMConversation$MessageCache;

    move-result-object v0

    iget-object v1, p0, Lcom/hyphenate/chat/EMChatManager$3;->val$oldId:Ljava/lang/String;

    invoke-virtual {v0, v1}, Lcom/hyphenate/chat/EMConversation$MessageCache;->removeMessage(Ljava/lang/String;)V

    iget-object v0, p0, Lcom/hyphenate/chat/EMChatManager$3;->val$conv:Lcom/hyphenate/chat/EMConversation;

    invoke-virtual {v0}, Lcom/hyphenate/chat/EMConversation;->getCache()Lcom/hyphenate/chat/EMConversation$MessageCache;

    move-result-object v0

    iget-object v1, p0, Lcom/hyphenate/chat/EMChatManager$3;->val$msg:Lcom/hyphenate/chat/EMMessage;

    invoke-virtual {v0, v1}, Lcom/hyphenate/chat/EMConversation$MessageCache;->addMessage(Lcom/hyphenate/chat/EMMessage;)V

    :cond_0
    iget-object v0, p0, Lcom/hyphenate/chat/EMChatManager$3;->val$originImagePath:Ljava/lang/String;

    if-eqz v0, :cond_2

    iget-object v0, p0, Lcom/hyphenate/chat/EMChatManager$3;->val$msg:Lcom/hyphenate/chat/EMMessage;

    invoke-virtual {v0}, Lcom/hyphenate/chat/EMMessage;->getBody()Lcom/hyphenate/chat/EMMessageBody;

    move-result-object v0

    instance-of v0, v0, Lcom/hyphenate/chat/EMImageMessageBody;

    if-eqz v0, :cond_2

    iget-object v0, p0, Lcom/hyphenate/chat/EMChatManager$3;->val$msg:Lcom/hyphenate/chat/EMMessage;

    invoke-virtual {v0}, Lcom/hyphenate/chat/EMMessage;->getBody()Lcom/hyphenate/chat/EMMessageBody;

    move-result-object v0

    check-cast v0, Lcom/hyphenate/chat/EMImageMessageBody;

    invoke-virtual {v0}, Lcom/hyphenate/chat/EMImageMessageBody;->getLocalUrl()Ljava/lang/String;

    move-result-object v0

    const-string/jumbo v1, "EMChatManager"

    new-instance v2, Ljava/lang/StringBuilder;

    invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V

    const-string/jumbo v3, "origin: + "

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    iget-object v3, p0, Lcom/hyphenate/chat/EMChatManager$3;->val$originImagePath:Ljava/lang/String;

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    const-string/jumbo v3, ", scale:"

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-static {v1, v2}, Lcom/hyphenate/util/EMLog;->d(Ljava/lang/String;Ljava/lang/String;)V

    if-eqz v0, :cond_1

    iget-object v1, p0, Lcom/hyphenate/chat/EMChatManager$3;->val$originImagePath:Ljava/lang/String;

    invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v1

    if-nez v1, :cond_1

    new-instance v1, Ljava/io/File;

    invoke-direct {v1, v0}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    invoke-virtual {v1}, Ljava/io/File;->exists()Z

    move-result v0

    if-eqz v0, :cond_1

    invoke-virtual {v1}, Ljava/io/File;->delete()Z

    :cond_1
    iget-object v0, p0, Lcom/hyphenate/chat/EMChatManager$3;->val$msg:Lcom/hyphenate/chat/EMMessage;

    invoke-virtual {v0}, Lcom/hyphenate/chat/EMMessage;->getBody()Lcom/hyphenate/chat/EMMessageBody;

    move-result-object v0

    check-cast v0, Lcom/hyphenate/chat/EMImageMessageBody;

    iget-object v1, p0, Lcom/hyphenate/chat/EMChatManager$3;->val$originImagePath:Ljava/lang/String;

    invoke-virtual {v0, v1}, Lcom/hyphenate/chat/EMImageMessageBody;->setLocalUrl(Ljava/lang/String;)V

    iget-object v0, p0, Lcom/hyphenate/chat/EMChatManager$3;->this$0:Lcom/hyphenate/chat/EMChatManager;

    iget-object v1, p0, Lcom/hyphenate/chat/EMChatManager$3;->val$msg:Lcom/hyphenate/chat/EMMessage;

    invoke-virtual {v0, v1}, Lcom/hyphenate/chat/EMChatManager;->updateMessage(Lcom/hyphenate/chat/EMMessage;)Z

    :cond_2
    return-void
.end method
